export function Toast(options) {
    let txt, icon;
    if (typeof options === 'string') {
        txt = options; icon = 'none';
    } else {
        txt = options.txt;
        icon = options.icon || 'none';
    }
    wx.showToast({
        title: txt,
        icon
    });
}

export function Loading(options = '加载中...') {
    let txt, mask;
    if (typeof options === 'string') {
        txt = options; mask = true;
    } else {
        txt = options.txt;
        mask = options.mask;
    }
    return wx.showLoading({
        title: txt, mask
    })
}

export function HideLoading() {
    wx.hideLoading();
}

